import java.util.Arrays;

public class Solution455 {
    public int findContentChildren(int[] g, int[] s) {
        int i=0,j=0;
        int ans=0;
        Arrays.sort(g);
        Arrays.sort(s);
        while (i<g.length && j<s.length){
            if (s[j]>=g[i]){
                ans++;
                i++;
            }
            j++;
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution455().findContentChildren(new int[]{1,2,3},new int[]{1,1}));
    }
}
